Consistent parsing for HTTP CONNECT request method (PHP SAPI)#255
Merged
SimonFrings merged 2 commits intoclue:mainfrom Apr 15, 2024
Merged
Consistent parsing for HTTP CONNECT request method (PHP SAPI)#255SimonFrings merged 2 commits intoclue:mainfrom
CONNECT request method (PHP SAPI)#255SimonFrings merged 2 commits intoclue:mainfrom
Conversation
SimonFrings
approved these changes
Apr 15, 2024
Contributor
SimonFrings
left a comment
There was a problem hiding this comment.
Looks good, let's get this in 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changeset improves consistency when parsing incoming HTTP proxy requests using the
CONNECTrequest method when using the PHP SAPI. We already reject any such requests with a400 Bad Requesterror response consistently (see #46). On top of this, we now also consistently parse the request URI in case the request will be processed through any global request middleware handlers. This does not otherwise affect our public API and comes with full code coverage, so this should be safe to apply.In particular, ReactPHP now ships a new PSR-7 implementation and no longer uses the dated RingCentral PSR-7 implementation. The updated tests are now in line with the requirements outlined by PSR-7 which are now properly enforced via reactphp/http#521 and reactphp/http#522. Specifically, a
CONNECTrequest now uses a request URI with the appropriate scheme specified. The previous test used incorrect assumptions provided by the dated RingCentral PSR-7 implementation and has been in place ever since #46 has been merged several years ago.Builds on top of #46, reactphp/http#521, reactphp/http#201, reactphp/http#158 and others